function [V,rho,p,psi,theta,vx,vy] = cfdexactSolutionRingleb(xp,yp)
%--------------------------------------------------------------------------
%  Written by LiuHaHa @ NWPU, 2022 01 
%  Contact me at: liuzhikan@mail.nwpu.edu.cn
%==========================================================================
% Routine Description:
%   This function calculate the exact solution of Ringleb flow 
%--------------------------------------------------------------------------
fifth=0.2; half=0.5; one=1.0; three=3.0; five=5.0;

V = V_from_xy_fpitr(xp, yp, 0.0, 2.0);

%Once V is obtained, everything else can be computed.
b = sqrt(one - fifth*V*V);
rho = b^five;
p = b^7;
L = one/b + one/(three*b^three) + one/(five*b^five)- half*log( (one+b) / (one-b) );
psi = sqrt( half/V^2-(xp-half*L)*rho );

Vpsi = sqrt( half-V*V*(xp-half*L)*rho );

if ( abs( Vpsi - one ) < 1.0e-15 )
	theta = half*3.141592653589793238;
else
	theta = asin( psi*V );
end

vx = -V*cos(theta);
vy = -V*sin(theta);

